<%-- 
    Document   : AddToCart
    Created on : Jul 21, 2011, 1:11:08 AM
    Author     : HOANG ANH
--%>
<%@page import="BUSObject.Product"%>
<%@page import="BUSObject.CartItem"%>
<%@taglib tagdir="/WEB-INF/tags/template/" prefix="template" %>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<jsp:useBean id="BeanCart" scope="session" class="BUS.BUSCart" />
<%
    int id = Integer.parseInt(request.getParameter("ID"));
    if (id > 0) {
        String name = request.getParameter("Name");
        float price = Float.parseFloat(request.getParameter("Price"));

        Product p = new Product(id, name, price);
        
        BeanCart.AddProduct(p);
        
        
    }else{
        response.sendRedirect("index.jsp");
        return;
    }
%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Add2Cart</title>
    </head>
    <template:header level="0"></template:header>
    <template:StartContent level="0"></template:StartContent>
    <h1>Add to Cart Success</h1>
    Product ID : <%= request.getParameter("ID")%><br/>
    Product Name : <%= request.getParameter("Name")%><br/>
    Price : <%= request.getParameter("Price")%><br/>
    <template:EndContent></template:EndContent>
    <template:Footer></template:Footer>
</html>
